<?php
class smarty_ext_subscribe_news {

	function smarty_ext_subscribe_news() {
		global $setupdata, $mysqlclass, $subscribe_newsclass;
		$this->setupdata=$setupdata;
		$this->mysqlclass=$mysqlclass;
		$this->subscribe_newsclass=$subscribe_newsclass;
	}
	
	function get_all_subscribers($params){
		$result = array();
		if (isset($params['type']) && ($params['type']=="unsub")) {
			$sql = $this->mysqlclass->mysql_my_query("SELECT * FROM `".$this->setupdata['table_prefix']."subscribe_news` WHERE `status`=0 ORDER BY `regdate` DESC", __LINE__, __FILE__);
		} else {
			$sql = $this->mysqlclass->mysql_my_query("SELECT * FROM `".$this->setupdata['table_prefix']."subscribe_news` WHERE `status`=1 ORDER BY `regdate` DESC", __LINE__, __FILE__);
		}
		while ($row = mysql_fetch_array($sql, MYSQL_ASSOC)) $result[$row['id']] = $row;
		return $result;
	}
}
?>